<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 对象解构允许我们使用变量的名字匹配对象的属性 匹配成功将对象属性的值赋值给变量
        let person = {
            name: '刘德华',
            sge: 18,
            sex: '男'
        };
        let { name, sge, sex } = person;
        console.log(name);
        console.log(sge);
        console.log(sex);
        console.log('----------------');
        let { name: Myname } = person;
        console.log(Myname);
    </script>
</body>

</html>